// 数组排序
const compare = (property) => {
  return function(a, b) {
    const value1 = a[property]
    const value2 = b[property]
    /*
    * value2 - value1; ——> 降序
    * value1 - value2; ——> 升序
    */
    return value1 - value2// 升序排序
  }
}
export default compare
